package com.jbp.dao;

import com.jbp.model.RoomUserWheat;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 
 * 
 * @author lucheng feng
 * @email jbp@gmail.com
 * @date 2020-06-18 21:26:42
 */

public interface RoomUserWheatDao extends BaseMapper<RoomUserWheat> {

    @Select("select user_id from room_user_wheat where room_id=#{roomId}")
    List<Integer> getUserIds(@Param("roomId") Integer roomId);

    @Select("select DISTINCT(room_id) from room_user_wheat ")
    List<RoomUserWheat> notEmptyRooms();

    @Select("select DISTINCT(user_id) from room_user_wheat")
    List<Integer> allUserIds();
}
